package common.config.feign;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;

/**
 * Feign配置
 *
 * @author 米泽鹏
 * @since 2023-11-27 下午 12:37
 */
@Configuration
public class FeignConfig {

	/**
	 * 监听器：监听HTTP请求事件
	 * 解决FeignInterceptor中RequestContextHolder.getRequestAttributes()为null的问题
	 */
	@Bean
	public RequestContextListener requestContextListener() {
		return new RequestContextListener();
	}

}
